<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="./css/font.css">
    <link rel="stylesheet" href="./css/xadmin.css">
    <script src="./lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="./js/xadmin.js"></script>
    <script type="text/javascript" src="./js/jquery.min.js"></script>
    <title>添加院系管理</title>
</head>
<style>
    .layui-form{
        height: 300px;
       
    }
    .buttonOne{
       width: 50%;
       height: 40px;
       margin-top: 200px;
       background-color: aquamarine;
    }
</style>
<body>
    <form id="form" class="layui-form" action=" ">
            <div class="layui-form-item">
            		<label class="layui-form-label">id</label>
                    <div class="layui-input-block">
                      <input type="text" name="dep_id" required  lay-verify="required" readonly="readonly" value="${itmes.dep_id}" autocomplete="off" class="layui-input">
                    </div>
                    <label class="layui-form-label">院系名称</label>
                    <div class="layui-input-block">
                      <input type="text" name="department" required  lay-verify="required" placeholder="${itmes.department}" autocomplete="off" class="layui-input">
                    </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block buttonOne">
                    <button class="btn layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-normal">重置</button>
                    <button type="button" class="layui-btn layui-btn-warm">取消</button>
                </div>
            </div>
    </form>
</body>
<script>
$(function () {       
	$(".btn").click( function () {
		var url="${pageContext.request.contextPath}/depUpdate";
		var param=$("#form").serialize();
		$.post(url,param,function(data){
		 	if(data.flag==0){
				alert(data.msg);
			}
			if(data.flag==1){
				alert(data.msg);
				window.parent.location.reload();//刷新父页面
		        var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
		        parent.layer.close(index);
			} 
		});
	});
});
</script>
</html>